﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using Sexybeauty.Core.Inf.Entities.Table;

namespace Sexybeauty.Core.Inf.Entities
{
    public class Context : DbContext
    {
        public static string CONNECTION_STRING = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectStr"].ToString();

        #region DbContext
        public DbSet<Member> Member { get; set; }
        public DbSet<MemberDetail> MemberDetail { get; set; }
        public DbSet<MemberAccount> MemberAccount { get; set; }
        public DbSet<MemberAccountLog> MemberAccountLog { get; set; }
        public DbSet<MemberResource> MemberResource { get; set; }
        public DbSet<ShortMessage> ShortMessage { get; set; }
        public DbSet<AccountStream> AccountStream { get; set; }
        public DbSet<Discuss> Discuss { get; set; }
        public DbSet<Frends> Frends { get; set; }
        #endregion

        public Context()
            : base(CONNECTION_STRING)
        { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}
